<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../common/tag.jsp"%>
<form role="form"  id="daily_info">
    <div class="form-group">
        <label for="daily_title">标题：</label>
        <input type="text" id="daily_title" name="dailyTitle">
    </div>
    <div class="form-group">
        <label for="daily_detail">内容：</label>
        <textarea rows="3" cols="30" form="daily_info" id="daily_detail" name="dailyDetail"></textarea>
    </div>
    <input type="hidden" name="weekIndex" value="${weekIndex}">
    <div class="btn-group">
        <button type="button" onclick="doSubmit()">提交</button>
    </div>
</form>
<script type="application/javascript">
    function doSubmit(){
        //检查svn版本为数字
        if(confirm("日志不支持修改，确认提交么？")){
            $.ajax({
                type:"POST",
                url:"/t/n/dailySubmit",
                data:$("#daily_info").serialize(),
                dataType:"json",
                success: function (result) {
                    //提交成功-刷新c栏
                    if(result['success']){
                        var data = result['data'];
                        //刷新B栏
                        home.a.init({
                            "menuId":"h-menu-record"
                        });
                        //刷新C栏
                        home.b.getDailyById(data.dailyId);
                    }else{
                        alert(result['error']);
                    }
                }
            });
        }
    }
</script>